/**
 * Copyright 2013 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.viettel.core.enumtype;

import java.util.HashMap;
import java.util.Map;

/**
 *  Mo ta muc dich cua lop (interface)
 *  @author: ToanTM1
 *  @version: 2.1
 *  @since: 28-02-2014 - 10:17:14
 */
public enum ServiceObjectType {
	 TYPE_0 (0),
     TYPE_1 (1),
     TYPE_2 (2);
     
     
     /** The value. */
     private Integer value;
     
     /** The values. */
     private static Map<Integer, ServiceObjectType> values = null;
     
     /**
      * Gets the value.
      * 
      * @return the value
      */
     public Integer getValue() {
         return value;
     }
     
     /**
      * Instantiates a new gender type.
      * 
      * @param value
      *            the value
      */
     ServiceObjectType(Integer value) {
         this.value = value;
     }
     
     /**
      * Parses the value.
      * 
      * @param value
      *            the value
      * @return the gender type
      */
     public static ServiceObjectType parseValue(Integer value) {
     	if (value != null && value == -1){
     		value = 2;
     	}    		
         if (values == null) {
             values = new HashMap<Integer, ServiceObjectType>(
                     ServiceObjectType.values().length);
             for (ServiceObjectType e : ServiceObjectType.values())
                 values.put(e.getValue(), e);
         }
         return values.get(value);
     }
 }
